﻿
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <title>WLBLOG</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="WLBLOG">
	<meta name="keywords" content="WLBLOG,WLBLOG">

    <!-- Le styles -->
    <link href="http://cdn.bootcss.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/bootstrap/2.3.2/css/bootstrap-responsive.min.css" rel="stylesheet">
	<link href="http://cdn.bootcss.com/highlight.js/8.6/styles/monokai_sublime.min.css" rel="stylesheet">
	<style>
	body{font-family:"ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Helvetica Neue",Helvetica,Arial,"Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei UI","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;}
	</style>
	<style>
		.w90{width:90%;margin-left: auto;margin-right: auto;}
		.w60{width:60%;margin-left: auto;margin-right: auto;}
		.w35{width:35%;margin-left: auto;margin-right: auto;}
	</style>
	<style type="text/css">
		a:link {
		 text-decoration: none;
		}
		a:visited {
		 text-decoration: none;
		}
		a:hover {
		 text-decoration: none;
		}
		a:active {
		 text-decoration: none;
		}
	</style>
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.min.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
  </head>

  <body data-spy="scroll" data-target=".bs-docs-sidebar">
	<header class="jumbotron w90" id="overview">
			<h1>WLBLOG </h1>
		<p class="lead">这是副标题</p>

		<div class="navbar navbar-inverse">
			<div class="navbar-inner">
				<div class="container">
					<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</a>

					<a class="brand" href="index.html">Home</a>
					<div class="nav-collapse">
						<ul class="nav">
							<li class="divider-vertical"></li>
							
						 </ul>
					</div>
				</div>
			</div>
		</div>
	</header>
	<div class="container-fluid w90">
		  <div class="row-fluid">
			<div class="span3">
			<br>
			  <div class="well sidebar-nav " style="width:70%">
				<ul class="nav nav-list">
				  <li class="active">最新：</li>
				  
					<li><a href="1.html">Linux批量运维实战：WEB化批量执行命令&amp;文件上传</a></li>
				  
				</ul>
			  </div><!--/.well -->
			  <div class="well sidebar-nav" style="width:70%">
				<ul class="nav nav-list">
				  <li class="active">日期：</li>
				  
					<li><a href="201507.html">201507</a></li>
				  
				</ul>
			  </div><!--/.well -->
			  <div class="well sidebar-nav" style="width:70%">
				<ul class="nav nav-list">
				  <li class="active">類別：</li>
				  
					<li><a href="Python.html">Python</a></li>
				  
				</ul>
			  </div><!--/.well -->
			  <div class="well sidebar-nav " style="width:70%">
				<ul class="nav nav-list">
				  <li class="active">友情链接：</li>
					
				</ul>
			  </div><!--/.well -->
			</div><!--/span-->
		<div class="container span9">
		<a href='1.html' ><H1>Linux批量运维实战：WEB化批量执行命令&文件上传</H1></a>
                <br><b>tags：Linux,运维自动化,批量执行,批量上传   创建时间：2015-07-30 11:20:29</b><br><HR />
                <p>在之前的文章<a href="http://wangxun.me/10.html">http://wangxun.me/10.html</a>中有提到使用paramiko模块同时连接多台Linux主机执行命令的演示。通过这个演示我们已经可以比较方便的针对多台主机进行管理。本文中将更进一步使用Tornado提供一个WEB界面，通过WEB界面操作即可实现批量命令执行、文件上传。</p>
<p>首先我们需要一个资料库来存放主机信息。本文中我们使用SQLite，我们建立一张表：myhost
表中创建四个栏位：ID、HOST、USER、PWD分别记录序号，主机名、主机登入用户名、登入密码。
SQL如下：</p>
<pre><code>CREATE TABLE
</code></pre> <BR><HR />
		

	<!--<textarea class="form-control" rows="3" style="width:90%; margin-left:auto; margin-right:auto;"></textarea>-->
	</div>
	</div>
	<footer>
<center>
<p>Copyright @ 2015  汪勋的运维技术笔记 保留所有权利.<a href="http://www.miibeian.gov.cn/" target="_blank">浙ICP备15022898号-1</a>
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ff29896d9c71789306819a4bb0247b6fc' type='text/javascript'%3E%3C/script%3E"));
</script>
</p>
</center>
</footer>
	<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
	<script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
	<script src="http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js"></script>
	<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
